package com.list.demo;

import java.util.ArrayList;

public class Demo02 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        //  增
        list.add("张三");
        list.add("123");
        list.add("abc");
        list.add(",./");
        list.add("\uD83D\uDC09");
        System.out.println(list);
        //  删
        //  update(list);
        // 改 set
       // set(list);
        // 查  长度 size get
        String s = list.get(2);
        System.out.println(s);
        int size = list.size();
        System.out.println(size);

        System.out.println(list);

    }

    public static void set(ArrayList<String> list) {
        list.set(0,"🐀");
    }

    public static void update(ArrayList<String> list) {
        list.remove(4);
    }
}
